# Generated automatically from Makefile.in by configure.
# Makefile for TPIE test applications.
# Use gmake on this Makefile.  It relies on the default rules, and 
# Use gmake -p to see the default rules.
# $Id: Makefile.in,v 1.1 2003/09/24 19:33:50 tavi Exp $

CXX = g++
CC = gcc
MAKEDEPEND = $(CXX) -M

TPIEINC = ../../include
TPIELIBDIR = ../../lib
TPIELIB = $(TPIELIBDIR)/libtpie.a

ifdef DEBUG_APPS
LOG_APPS = 1
ASSERT_DEBUG_APPS = 1
endif

CXXFLAGS = 

# CPPFLAGS is used by the default rules. Using "override" and "+="
# allows the user to prepend things to CPPFLAGS on the command line.
override CPPFLAGS +=  -I$(TPIEINC)
# These options are set by the configure script.
override CPPFLAGS += -DHAVE_CONFIG_H
# These options are for large file support. They force all file access 
# calls to use the 64 bit variants. Several types change also, e.g. off_t 
# becomes off64_t.
override CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE

ifeq ($(MINUSG),1)
override CPPFLAGS += -g
else
override CPPFLAGS += -O3
endif

ifeq ($(MINUSPG),1)
override CPPFLAGS += -pg
endif

LDLIBS =  -L$(TPIELIBDIR) -ltpie -lm #-liberty

CCFLAGS = $(CXXFLAGS)

# The various test applications.

APPS := nas_ep \
	nas_ep2 \
	nas_cg \
	nas_is \
	nas_ep_mm \
	smooth \


# Sources to the test applications.
APPSRC = $(patsubst %,%.cpp,$(APPS))

# Other C++ sources for common support routines.
COMMONCXXSRC = parse_args.cpp  app_config.cpp

COMMONCSRC = getopt.c

OTHERCXXSRC = scan_build_smoother.cpp

CXXSRC = $(APPSRC) $(COMMONCXXSRC) $(OTHERCXXSRC)

CSRC = $(COMMONCSRC)

# Common objects that go into most apps.
COMMONOBJ = $(COMMONCXXSRC:.cpp=.o) $(COMMONCSRC:.c=.o)

# Translation rules:

%:%.o
	$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@


# Specific dependencies, explicit and automatic.

all: $(APPS)

depend: cleandepend 
	$(MAKEDEPEND) $(CPPFLAGS) $(CSRC) $(CXXSRC) >> Makefile.depend

clean: cleandepend
	-rm -f $(CXXSRC:.cpp=.o) $(CSRC:.c=.o) $(APPS)

distclean: clean

# What objects each of the apps acually needs.
nas_ep: nas_ep.o $(COMMONOBJ)
nas_ep2: nas_ep2.o $(COMMONOBJ)
nas_cg: nas_cg.o $(COMMONOBJ)
nas_is: nas_is.o $(COMMONOBJ)
nas_ep_mm: nas_ep_mm.o 
smooth: smooth.o scan_build_smoother.o  $(COMMONOBJ)

include Makefile.depend

Makefile.depend: $(CSRC) $(CXXSRC)
	rm -f Makefile.depend; \
	$(MAKEDEPEND) $(CPPFLAGS) $(CSRC) $(CXXSRC) >> Makefile.depend

cleandepend:
	-rm -f Makefile.depend

.PHONY : clean all depend cleandepend distclean


